package com.hbnu.controller;

import com.hbnu.pojo.Goods;
import com.hbnu.service.GoodsService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/goods") // 映射路径，类上的映射路径主要用于区分不同的业务
public class GoodsController {
    @Resource
    private GoodsService goodsService;

    @GetMapping("/findAll")
    @ResponseBody
    public List<Goods> findAll() {
        return goodsService.findAll();
    }

}
